package com.leetcode.partition18;

import java.io.*;

/**
 * @author `RKC`
 * @date 2022/1/15 8:53
 */
public class LC1716计算力扣银行的钱 {

    private static final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    private static final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

    public static void main(String[] args) throws IOException {
        int n = Integer.parseInt(reader.readLine());
        writer.write(totalMoney(n) + "\n");
        writer.flush();
    }

    public static int totalMoney(int n) {
        int answer = 0;
        for (int i = 1, j = 1; i <= n; i++) {
            answer += j++;
            if (i % 7 == 0) j = i / 7 + 1;
        }
        return answer;
    }
}
